package com.learn.sb.sblearnshardingjdbc.service.impl;

import com.learn.sb.sblearnshardingjdbc.dao.OrderDao;
import com.learn.sb.sblearnshardingjdbc.pojo.Order;
import com.learn.sb.sblearnshardingjdbc.service.OrderService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

	@Autowired
	private OrderDao orderDao;

	@Override
	public Order getOrder(Integer id) {
		return orderDao.getOrder(id);
	}

	@Override
	public Order getOrderByUserId(@Param("userId") Integer userId, @Param("orderId") Integer orderId) {
		return orderDao.getOrderByUserId(userId, orderId);
	}
}
